Skip to content

fix: respect explicit tsconfig files for alias resolution - #231

Closed
charan-rathore wants to merge 1 commit into
aleclarson:masterfrom
charan-rathore:fix/respect-tsconfig-files
Closed

charan-rathore wants to merge 1 commit into
aleclarson:masterfrom
charan-rathore:fix/respect-tsconfig-files

Conversation

@charan-rathore

Copy link
Copy Markdown

Description

Explicit tsconfig files entries are part of the project even if include is empty or exclude matches them. The plugin currently checks only include/exclude globs, so it skips valid aliases from those files. Conversely, a files-only config with no include incorrectly accepts every importer.

Check explicit files separately from globs. When files are specified without include, do not add the default include glob. Keep exclude filtering for files discovered through include, but do not apply it to explicitly listed files.

Three regression checks cover excluded explicit files, unlisted importers in a files-only project, and agreement with TypeScript through the real Vite resolver. They fail before the change and pass after it.

This adds the files support requested in #8. It keeps alias resolution and importer extension checks unchanged.

Validation: all 54 tests pass together with vitest run --isolate, lint, formatting, typecheck, and build pass. The default test config sets isolate: false. When resolver.test.ts loads the shared config module before config.test.ts, the latter file's filesystem mock does not intercept its already-loaded import. Its concurrency tracker stays at zero. This reproduces with baseline source when running these two files together. Enabling Vitest isolation fixes it; the runner uses that flag without changing repository configuration.

@charan-rathore

Copy link
Copy Markdown
Author

Closing since this has sat without activity. Glad to reopen if someone wants to take it forward.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant